'use strict';

import React, { PropTypes, Component } from 'react';

import classNames from '../utils/classNames';

class MemberList extends Component {
	constructor(props) {
	    super(props);
	    this.state = {
	    	show:false,
	    	hide:1
	    }
	}

	render() {
		let { memberList = [],memberCount=0 } = this.props;
		if(!(memberList && memberList[0]) || memberCount === 0){
			return null;
		}

		let memberListHtml = [],
			memberInfo,
			i = 0;
		for(;i<memberCount;i++){
			memberInfo = memberList[i];
			if(!memberInfo){
				memberInfo = {
					NickName:'',
				 	UserPicUrl:''
				 }
			}
			memberListHtml.push(<li key={i} className={classNames({pic:memberInfo.UserPicUrl},'item-1of'+memberCount)}><span style={{backgroundImage:`url(${memberInfo.UserPicUrl})`}}>?</span></li>)
		}

		return ( 
			<div className="member-list-wrapper">
				<div className="member-list-inner">
					<label>参团的小伙伴</label>
					<ul>{memberListHtml}</ul>
				</div>
			</div>
		)
	}
}

export default MemberList